package com.android.BluethootChess.activity;

import com.android.BluethootChess.activity.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;

public class ChooseColorOfPiecesActivity extends Activity {
	
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.default_window);
    }
	
	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if ((keyCode == KeyEvent.KEYCODE_BACK)) {
			Intent myIntent = new Intent(ChooseColorOfPiecesActivity.this,
					NewGameActivity.class);
			ChooseColorOfPiecesActivity.this.startActivity(myIntent);
			quitProcess();
		}

		return super.onKeyDown(keyCode, event);
	}

	private void quitProcess() {
		super.onDestroy();

		// After this is called, your app process is no longer available in DDMS
		android.os.Process.killProcess(android.os.Process.myPid());

	}

}
